package com.example.hospital.controller;

import com.example.common.util.core.controller.BaseController;
import com.example.common.util.core.resultbody.AjaxResult;
import com.example.hospital.service.DepartmentService;
import com.example.model.vo.hospital.DepartmentVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author juzipi
 * @Date 2021/7/13 10:59
 * @Info
 */
@Api(tags = "科室管理")
@RestController
@RequestMapping("admin/hospital/department")
public class DepartmentController extends BaseController {

    @Autowired
    private DepartmentService departmentService;


    //根据医院编号，查询医院所有科室列表
    @ApiOperation(value = "查询医院所有科室列表")
    @GetMapping("get/{hoscode}")
    public AjaxResult getDeptList(@PathVariable String hoscode) {
        List<DepartmentVo> list = departmentService.getDepartmentTree(hoscode);
        return AjaxResult.success(list);
    }


}
